package com.culture.config.model;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@Accessors(chain=true)
@NoArgsConstructor
public class AuthInfo {
	Long userId;
	String userName;
	List<String> roles;
	String authToken;
	Map<String,String> extras;
	
	public AuthInfo(Long userId,String userName) {
		this.userId = userId;
		this.userName = userName;
	}	
	
	public void addConfig(String key, String value) {
		if(this.extras == null) {
			this.extras = new HashMap<>();
		}
		this.extras.put(key, value);
	}
}
